// 定义修改操作

import * as types from './mutation-types'

const mutations = {
  // 第一个参数state 获取当前的state 第二个参数是提交时传的参数
  [types.SET_SINGER](state,singer) {
    state.singer = singer;
  },
  [types.SET_PLAYING_STATE](state,flag) {
    state.playing = flag;
  },
  [types.SET_FULL_SCREEN](state,flag) {
    state.fullScreen = flag;
  },
  [types.SET_PLAYLIST](state,list) {
    state.playlist = list;
  },
  [types.SET_SEQUENCE_LIST](state, list) {
    state.sequenceList = list;
  },
  [types.SET_PLAY_MODE](state, mode) {
    state.mode = mode;
  },
  [types.SET_CURRENT_INDEX](state, index) {
    state.currentIndex = index;
  },
  [types.SET_DISC](state, disc) {
    state.disc = disc;
  },
  [types.SET_TOP_LIST](state, list) {
    state.toplist = list;
  },
  [types.SET_SEARCH_HISTORY](state, searchHistory) {
    state.searchHistory = searchHistory;
  }
};

export default mutations
